package com.xuecheng.content.api;

import com.xuecheng.content.service.CoursePublishService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 26455
 * @version 1.0
 * @description TODO
 * @date 2023/2/9 10:56
 */
@Slf4j
@Api(value = "课程审核接口", tags = "课程审核接口")
@RestController
@RequestMapping("/courseaudit")
public class CourseAuditController {

    @Autowired
    private CoursePublishService coursePublishService;

    /**
     * 提交审核
     *
     * @param courseId
     */
    @ResponseBody
    @PostMapping("/commit/{courseId}")
    public void commitAudit(@PathVariable("courseId") Long courseId) {
        Long companyId = 1232141425L;
        coursePublishService.commitAudit(companyId, courseId);
    }

    /**
     * 审核
     *
     * @param courseId
     */
    @ResponseBody
    @PostMapping("/audit/{courseId}")
    public void audit(@PathVariable("courseId") Long courseId, boolean audit) {
        Long companyId = 1232141425L;
        coursePublishService.audit(companyId, courseId, audit);
    }
}
